const hasCycle = head => {
  let slow = head, fast = head
  while (slow && fast.next) {
    slow = head.next
    fast = head.next.next
    if (slow == fast) return true
  }
  return false
}